<?
/**
* Copyright (c) 2002-2007 BioWare Corp.
* http://www.bigdaddymonitor.org
*
* This file is part of the BigDaddy Monitoring
* program. It is free software distributed under
* the terms of the BSD License. It is ditributed
* in the hopes that it will be useful, but
* WITHOUT ANY WARRANTY; without event the implied
* warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE.
*
* The BSD License is available from:
* http://www.opensource.org/licenses/bsd-license.php
**/
?>
                <?

		if (is_array($displayParams["aPageFunctions"]))
		{


		    $bFirst=true;


		    ?>
		
		    <div align="right">
			<?
			$aSortedPageFunctions = $displayParams["aPageFunctions"];

			// sort based on the 'nSortOrder' entry in aPageFunctions
			uasort($aSortedPageFunctions, create_function('$a,$b', '
				if ($a["nSortOrder"] == $b["nSortOrder"]) { return 0; }
				return ($a["nSortOrder"] < $b["nSortOrder"]) ? -1 : 1;
			    '));

			
			foreach ($aSortedPageFunctions as $sFunctionKey => $sFunctionValue)
			{
			    $sURL=$_SERVER["PHP_SELF"]."?";
			    
			    foreach ($displayParams["aPageFunctions"][$sFunctionKey]["aURL"] as $sURLKey => $sURLValue)
			    {
				
				$sURL.=$sURLKey."=".$sURLValue."&";
				
			    }
			    
			    $sURL=substr($sURL,0,strlen($sURL)-1);
			    
			    $nCount = "";
			    if($displayParams["aPageFunctions"][$sFunctionKey]["nNew"] > 0)
			    {
				$nCount = "(" . $displayParams["aPageFunctions"][$sFunctionKey]["nNew"] . " new)";
			    }
			    
			    ?>
				<a href="<?=$sURL;?>">
				    <img src="<?=THEME_DIR;?>/images/<?=$sFunctionKey;?>.gif" class="wiki_icon_padding">
				<span class="wiki_functions_font"><?=$displayParams["aPageFunctions"][$sFunctionKey]["sDescription"];?><?=$nCount?></span>
				</a>
			    <?
			}

			if ($displayParams["bShowNotify"])
			{
			    if ($displayParams["bShowNotifyEnabled"])
			    {
				$sAction = 'removenotify';
				$sNotifyChecked = 'checked';
			    }
			    else
			    {
				$sAction = 'notifyme';
				$sNotifyChecked = '';
			    }
			    ?>
			    
			    <a href="<?=$_SERVER["PHP_SELF"]."?action=".$sAction."&wiki=".$displayParams["aWikiProperties"]["sWikiID"]."&page=".$displayParams["aWikiProperties"]["sCurrentWikiPage"];?>">
			    <input type="checkbox" <?=$sNotifyChecked ?>
			    
				onclick="javascript:window.location.href='<?=$_SERVER["PHP_SELF"]."?action=".$sAction."&wiki=".$displayParams["aWikiProperties"]["sWikiID"]."&page=".$displayParams["aWikiProperties"]["sCurrentWikiPage"];?>';"
				
				><span class="wiki_functions_font">subscribe</span>
			    </a>
			    <?
			}


			?>
		    </div>
		    <?
		}
	        ?>
